home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Atari Compendium
/
The Atari Compendium (Toad Computers) (1994).iso
/
files
/
prgtools
/
gnustuff
/
minix
/
update~4.z
/
update~4
/
lib_stdio_getw.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1989-09-06
|
414 b
|
25 lines
/* g e t w
*
* Read a word from a stream. The function will return EOF on error.
* Because EOF is also a valid integer, it is better to check for
* errors using ferror.
*
* Patchlevel 1.0
*
* Edit History:
*/
#include "stdiolib.h"
/*LINTLIBRARY*/
int getw(fp)
FILE *fp; /* stream */
{
int w; /* word read */
return fread((void *) &w, (unsigned int)sizeof(int), 1, fp) == 1 ? w : EOF;
}